package com.mc.service.impl;

import com.mc.bean.Student;
import com.mc.dao.Impl.StudentDaoImpl;
import com.mc.dao.StudentDao;
import com.mc.service.StudentService;

import java.util.List;

/**
 * @author zl
 * 学生业务逻辑实现类
 */
public class StudentServiceImpl implements StudentService {
    StudentDao studentDao = new StudentDaoImpl();

    @Override
    public List<Student> findAll() {
        return studentDao.findAll();
    }

    @Override
    public Student findBySid(int sid) {
        return studentDao.findBySid(sid);
    }

    @Override
    public Student login(String tel, String pass) {
        return studentDao.findByTelPass(tel,pass);
    }

    @Override
    public List<Student> findByColId(int colid) {
        return studentDao.findByColId(colid);
    }

    @Override
    public List<Student> findByGid(int gid) {
        return studentDao.findByGid(gid);
    }

    @Override
    public boolean add(Student student) {
        return studentDao.add(student)>0?true:false;
    }

    @Override
    public boolean delete(int sid) {
        return studentDao.delete(sid)>0?true:false;
    }

    @Override
    public boolean update(Student student) {
        return studentDao.update(student)>0?true:false;
    }

    @Override
    public Student findByStel(String stel) {
        return studentDao.findByStel(stel);
    }
}
